using Serpis;
using System;

namespace PVenta
{
	[Label("Articulos")]
	public class ArticuloListView : EntityListView
	{
		private string selectSql = "select a.Id as Id, a.Nombre as Nombre, a.Categoria.Nombre as Categoria " +
			"from Articulo a left join a.Categoria c";// where a.Nombre like :nombre";
		
//		private string selectSql = "from Articulo";

		public ArticuloListView () : base(typeof(Articulo), typeof(ArticuloView))
		{
			label.LabelProp= "Nombre del articulo";
			entry.Text= selectSql;
			
			init();
		}
		
		protected override string getSql() {
			return string.Format(selectSql, entry.Text);
		}
	}
}
